<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.0.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/ficon.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/icon.png">
  <link rel="mask-icon" href="/images/icon.png" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"bqlin.github.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":true,"comments":{"style":"tabs","active":"gitalk","storage":true,"lazyload":false,"nav":{"gitalk":{"order":-2}},"activeClass":"gitalk"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":-1,"unescape":false,"preload":false},"motion":{"enable":false,"async":true,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="我们常说的视频文件格式常常只是多媒体封装格式，里面不仅包含了视频，还有音频、字幕等媒体信息。而纯视频码流的格式更多使用使用编码格式表达。 多媒体封装格式（Multimedia Container Format，简称MCF、多媒体容器），是一种开放（没有身份规限，免费）、自由的数据格式。">
<meta property="og:type" content="article">
<meta property="og:title" content="多媒体容器">
<meta property="og:url" content="https://bqlin.github.io/posts/multimedia_container/index.html">
<meta property="og:site_name" content="權咚领域">
<meta property="og:description" content="我们常说的视频文件格式常常只是多媒体封装格式，里面不仅包含了视频，还有音频、字幕等媒体信息。而纯视频码流的格式更多使用使用编码格式表达。 多媒体封装格式（Multimedia Container Format，简称MCF、多媒体容器），是一种开放（没有身份规限，免费）、自由的数据格式。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/bqlin/image-land/raw/master/Gb5mrn.jpg">
<meta property="og:image" content="https://gitee.com/bqlin/image-land/raw/master/BkC2zj.jpg">
<meta property="og:image" content="https://gitee.com/bqlin/image-land/raw/master/0QxdDS.jpg">
<meta property="article:published_time" content="2021-03-14T20:34:44.000Z">
<meta property="article:modified_time" content="2021-10-28T04:26:38.000Z">
<meta property="article:author" content="權咚">
<meta property="article:tag" content="音视频">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/bqlin/image-land/raw/master/Gb5mrn.jpg">

<link rel="canonical" href="https://bqlin.github.io/posts/multimedia_container/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>多媒体容器 | 權咚领域</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-105338942-1"></script>
    <script>
      if (CONFIG.hostname === location.hostname) {
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'UA-105338942-1');
      }
    </script>


  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?98fcf61fd269408d07dcbc1e49311f9a";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="權咚领域" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">權咚领域</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Making app a work of art.</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://bqlin.github.io/posts/multimedia_container/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/icon.png">
      <meta itemprop="name" content="權咚">
      <meta itemprop="description" content="🤘🤯👾">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="權咚领域">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          多媒体容器
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-03-15 04:34:44" itemprop="dateCreated datePublished" datetime="2021-03-15T04:34:44+08:00">2021-03-15</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-10-28 12:26:38" itemprop="dateModified" datetime="2021-10-28T12:26:38+08:00">2021-10-28</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E9%9F%B3%E8%A7%86%E9%A2%91%E6%A6%82%E5%BF%B5/" itemprop="url" rel="index"><span itemprop="name">音视频概念</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>3.1k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>3 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>我们常说的视频文件格式常常只是多媒体封装格式，里面不仅包含了视频，还有音频、字幕等媒体信息。而纯视频码流的格式更多使用使用编码格式表达。</p>
<p><strong>多媒体封装格式</strong>（<strong>M</strong>ultimedia <strong>C</strong>ontainer <strong>F</strong>ormat，简称MCF、多媒体容器），是一种开放（没有身份规限，免费）、自由的数据格式。</p>
<p>多媒体文件是个容器。容器里面存在多个<strong>流（stream/track）</strong>。每种流是由不同的编码器编程生成的。从流中读出的数据称为<strong>包</strong>。在一个包中包含一个或多个<strong>帧</strong>。</p>
<p>容器格式内部对音视频数据的处理都是大同小异，区别点并不大。更多的差距在于它们对于不同编码格式的支持程度、元数据的详细程度以及对于是否能够支持音视频以外的数据。</p>
<p>不同的容器具有不同的特点，下面简单介绍常用的多媒体容器。</p>
<h2 id="avi">AVI</h2>
<p>AVI，Audio Video Interleave。</p>
<ul>
<li>机构：Mircrosoft</li>
<li>不支持流媒体</li>
<li>支持编解码器：几乎所有</li>
<li>BT下载视频</li>
</ul>
<p>一种RIFF（Resource Interchange File Format）文件格式。同样使用RIFF文件格式还有WAV格式文件。RIFF使用小端序存储。</p>
<p>主体中的图像数据和声音数据是交叉存放的，以此达到音视频同步。从尾部的索引可以跳转到要播放的位置。</p>
<p>播放时间没有直接的字段由读取的帧数和帧率计算得出。</p>
<p>缺点：</p>
<ul>
<li>由于索引在文件尾部，所以不适合用来流传输。</li>
<li>容器中我没有时间戳，只能通过帧数和帧率计算得出。在索引中也没有写明时间戳和媒体位置的信息，所以在播放AVI时seek操作还需要额外的技术手段。</li>
<li>由于媒体数据分块存放，使得它对很多使用运动预测特定的视频编码的支持不是很好，因为预测帧需要访问帧外的数据。</li>
</ul>
<h3 id="二进制构成">二进制构成</h3>
<p>AVI文件是一个类型为<code>AVI</code>的RIFF块，主要有三个subchunk构成：</p>
<ul>
<li><code>hdrl</code> LIST，信息块：元数据</li>
<li><code>movi</code> LIST，数据块：保存音视频序列数据</li>
<li><code>idxl</code> LIST，索引块（可选）</li>
</ul>
<p>结构示意：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">RIFF (‘AVI ’</span><br><span class="line">      LIST (‘hdrl’</span><br><span class="line">            ‘avih’(主AVI信息头数据)</span><br><span class="line">            LIST (‘strl’</span><br><span class="line">                  ‘strh’ (流的头信息数据)</span><br><span class="line">                  ‘strf’ (流的格式信息数据)</span><br><span class="line">                  [‘strd’ (可选的额外的头信息数据) ]</span><br><span class="line">                  [‘strn’ (可选的流的名字) ]</span><br><span class="line">                  ...</span><br><span class="line">                 )</span><br><span class="line">             ...</span><br><span class="line">           )</span><br><span class="line">      LIST (‘movi’</span><br><span class="line">            &#123; SubChunk | LIST (‘rec ’</span><br><span class="line">                              SubChunk1</span><br><span class="line">                              SubChunk2</span><br><span class="line">                              ...</span><br><span class="line">                             )</span><br><span class="line">               ...</span><br><span class="line">            &#125;</span><br><span class="line">            ...</span><br><span class="line">           )</span><br><span class="line">      [‘idx1’ (可选的AVI索引块数据) ]</span><br><span class="line">     )</span><br></pre></td></tr></table></figure>
<p><img src="https://gitee.com/bqlin/image-land/raw/master/Gb5mrn.jpg" /></p>
<p>参考：</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://www.cnblogs.com/tocy/p/media_container_8-avi.html">多媒体文件格式之AVI - Tocy - 博客园</a></li>
<li><a target="_blank" rel="noopener" href="https://sp4n9x.github.io/2020/12/30/AVI%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F%E5%88%86%E6%9E%90/">AVI文件格式分析 | Sp4n9x's Blog</a></li>
</ul>
<h2 id="mov">MOV</h2>
<p>MOV，QuickTime File Format（QTFF）</p>
<ul>
<li>机构：Apple</li>
<li>支持流媒体</li>
<li>支持编解码器：
<ul>
<li>音：AAC、MPEG-1 Layers I/II/III、AC-3等</li>
<li>视：MPEG-2/4、H.264等</li>
</ul></li>
<li>点播、直播</li>
</ul>
<h3 id="相关概念">相关概念</h3>
<p>atom：QTFF的基本数据单元，可以来容纳实际的音视频数据，也可以放置元数据和字幕等信息，通过层层嵌套方式形成树状结构。atom容纳的数据类型和大小在atom头部进行描述。</p>
<h2 id="mp4">MP4</h2>
<p>MP4，MPEG-4 Part14</p>
<ul>
<li>机构：MPEG</li>
<li>支持流媒体</li>
<li>支持编解码器：
<ul>
<li>音：AAC、MPEG-1 Layers I/II/III、AC-3等</li>
<li>视：MPEG-2/4、H.264、H.263等</li>
</ul></li>
<li>互联网视频网站</li>
</ul>
<p>MP4由多个包含不同信息的box，以树形式组织构成，与MOV的atom几乎一致。</p>
<p>根结点下包含三个box：</p>
<ul>
<li><code>ftyp</code>：文件类型</li>
<li><code>moov</code>：元数据</li>
<li><code>mdat</code>：媒体数据</li>
</ul>
<p>把moov放到mdat前面可以更快准备播放。</p>
<h3 id="box结构">box结构</h3>
<p>构成：</p>
<ul>
<li>header：指明box大小和类型；
<ul>
<li>增加了<code>version</code>（8位）和<code>flags</code>（24位）字段的成为FullBox。</li>
<li>当size等于0时，代表这个box是文件最后一个box。当size等于1时，说明box长度需要更多的位来描述，在后面会定义一个64位的largesize来描述box的长度。</li>
</ul></li>
<li>body：数据或box</li>
</ul>
<h3 id="常用容器">常用容器</h3>
<ul>
<li><p>moov，音视频数据的元数据信息</p>
<ul>
<li><p>mvhd，影片文件头信息，未压缩过的影片信息的头容器</p></li>
<li><p>trak，多个，各轨道信息容器</p>
<ul>
<li><p>tkhd，轨道元数据（TrackID、Duration、音量等等）</p></li>
<li><p>edts</p>
<ul>
<li>如果没有该表，那么这个轨道会立即开始播放，一个空的 edts 数据用来定位对轨道的起始时间偏移位置</li>
</ul></li>
<li><p>mdia</p>
<ul>
<li><p>mdhd，媒体头</p></li>
<li><p>hdlr，句柄参考</p></li>
<li><p>minf，媒体信息</p>
<ul>
<li><p>vmhd，视频信息头</p></li>
<li><p>smhd，音频信息头</p></li>
<li><p>dinf，数据信息</p></li>
<li><p>stdl，采样表</p></li>
</ul></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
<p><img src="https://gitee.com/bqlin/image-land/raw/master/BkC2zj.jpg" /></p>
<p><code>mdat</code> box中的多媒体数据是没有结构的，是参考<code>moov</code>的<code>track</code> box解析。<code>moov</code>包含了整个多媒体文件的元数据，seek也是通过该box实现，通过其中的各个表查到数据偏移位置。</p>
<h2 id="flv">FLV</h2>
<p>FLV，FLash Video。</p>
<ul>
<li>机构：Adobe</li>
<li>支持流媒体</li>
<li>支持编解码器：
<ul>
<li>音：MP3、ADPCM、Linear PCM、AAC等</li>
<li>视：Sorenson、VP6、H.264</li>
</ul></li>
<li>互联网视频</li>
</ul>
<p>FLV常用做流媒体。</p>
<p>结构：</p>
<ul>
<li><p>FLV Header</p>
<ul>
<li><p>字符 FLV 签名字段</p></li>
<li><p>版本</p></li>
<li><p>保留标记</p></li>
<li><p>音视频标记</p></li>
<li><p>数据偏移</p></li>
</ul></li>
<li><p>FLV Body，这里body只是一个概念，具体直接就是PreviousTagSize和Tag</p>
<ul>
<li><p>PreviousTagSize #0：0</p></li>
<li><p>TAG #1</p>
<ul>
<li><p>TAG Header</p>
<ul>
<li><p>Type</p></li>
<li><p>DataSize</p></li>
<li><p><strong>TimeStamp</strong></p></li>
</ul></li>
<li><p>TAG Data</p>
<ul>
<li><p>Audio Tag Data</p>
<ul>
<li>第一个字节包含音频数据的参数信息</li>
<li>第二个字节开始为音频流数据</li>
</ul></li>
<li><p>Video Tag Data（同上）</p></li>
<li><p>Script Tag Data</p>
<ul>
<li>常用于展示元数据，存储的数据格式一般为 AMF 格式</li>
</ul></li>
</ul></li>
</ul></li>
<li><p>PreviousTagSize #1：上一个TAG大小。</p></li>
<li><p>TAG #2</p></li>
<li><p>PreviousTagSize #2</p></li>
<li><p>...</p></li>
</ul></li>
</ul>
<p>参考：</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://juejin.cn/post/6844903555027959822">Flv格式解析 - 掘金</a></li>
</ul>
<h2 id="ts">TS</h2>
<p>TS，MPEG2-TS</p>
<ul>
<li>机构：MPEG</li>
<li>支持流媒体</li>
<li>支持编解码器：
<ul>
<li>音：MPEG-1 Layers I/II/III、AAC</li>
<li>视：MPEG-1/2/4、H.264</li>
</ul></li>
<li>IPTV，低延时直播</li>
</ul>
<p>TS文件为传输流文件，其特点是要求从视频流的任意片段开始都是可以独立解码的。TS容器是为了流传输而设计的。</p>
<p>在MPEG-2标准中，有两种不同类型的码流输出到信道：一种是节目码流（Program Stream, PS），适用于没有误差产生的媒体存储，如DVD等存储介质（.vob）。另一种是传送流（Transport stream, TS)，适用于有信道噪声产生的传输，目前TS流广泛应用于广播电视中，如机顶盒等。</p>
<p>TS文件分层：</p>
<ul>
<li>ES，Elementary Stream：原始流，直接从编码器出来的裸数据。</li>
<li>PES，Packet Elemental Stream：分割打包的ES流，加入了PES头（PTS、DTS等）。PES由包头和playload组成。</li>
<li>TS层，Transport Stream：传输流。是在PES层的基础上加入数据流的识别和传输必须的信息。<strong>固定包长度为188字节</strong>，以便于找到帧的起始位置，易于从丢包中恢复。</li>
</ul>
<p>为了便于传输，实现时分复用，基本流ES必须打包，就是将顺序连续、连续传输的数据流按一定的时间长度进行分割，分割的小段叫包，因此打包也称为分组。</p>
<p>参考：<a target="_blank" rel="noopener" href="https://www.cnblogs.com/jiayayao/p/6832614.html">TS流基本概念</a>、<a target="_blank" rel="noopener" href="https://blog.csdn.net/dxpqxb/article/details/79654004">ts流格式详解</a></p>
<p><img src="https://gitee.com/bqlin/image-land/raw/master/0QxdDS.jpg" /></p>
<h2 id="mkv">MKV</h2>
<p>MKV，Matroska Video File</p>
<ul>
<li>机构：Matroska</li>
<li>支持流媒体</li>
<li>支持编解码器：几乎所有</li>
<li>点播、直播</li>
</ul>
<p>开放标准、免费使用，可放入多种媒体信息，且不限数量。而且是目前唯一一个支持封装ASS字幕的格式。</p>
<h2 id="参考">参考</h2>
<ul>
<li><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Comparison_of_video_container_formats">Comparison of video container formats - Wikipedia</a></li>
<li><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/529c3729f357">mp4文件格式解析 - 简书</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.xinoassassin.me/2019/10/Media-Containers/">多媒体容器格式变迁史 | 随写 - XinoAssassin's Blog</a></li>
</ul>

    </div>

    
    
    
        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E9%9F%B3%E8%A7%86%E9%A2%91/" rel="tag"># 音视频</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/posts/rtmp/" rel="prev" title="RTMP">
      <i class="fa fa-chevron-left"></i> RTMP
    </a></div>
      <div class="post-nav-item">
    <a href="/posts/flv/" rel="next" title="FLV格式">
      FLV格式 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="gitalk-container"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#avi"><span class="nav-text">AVI</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%9E%84%E6%88%90"><span class="nav-text">二进制构成</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#mov"><span class="nav-text">MOV</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%9B%B8%E5%85%B3%E6%A6%82%E5%BF%B5"><span class="nav-text">相关概念</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#mp4"><span class="nav-text">MP4</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#box%E7%BB%93%E6%9E%84"><span class="nav-text">box结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B8%B8%E7%94%A8%E5%AE%B9%E5%99%A8"><span class="nav-text">常用容器</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#flv"><span class="nav-text">FLV</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ts"><span class="nav-text">TS</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#mkv"><span class="nav-text">MKV</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8F%82%E8%80%83"><span class="nav-text">参考</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="權咚"
      src="/images/icon.png">
  <p class="site-author-name" itemprop="name">權咚</p>
  <div class="site-description" itemprop="description">🤘🤯👾</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">84</span>
          <span class="site-state-item-name">文章</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">6</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">10</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/bqlin" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;bqlin" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/hearingdog" title="Weibo → https:&#x2F;&#x2F;weibo.com&#x2F;hearingdog" rel="noopener" target="_blank"><i class="fab fa-weibo fa-fw"></i>Weibo</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://xiaozhuanlan.com/metal-reference-translation" title="https:&#x2F;&#x2F;xiaozhuanlan.com&#x2F;metal-reference-translation" rel="noopener" target="_blank">Metal内参</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://xiaozhuanlan.com/wwdc21" title="https:&#x2F;&#x2F;xiaozhuanlan.com&#x2F;wwdc21" rel="noopener" target="_blank">WWDC21 内参</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2016 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">權咚</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">279k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">4:14</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js"></script>

<script src="/js/utils.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>




  
<script src="/js/local-search.js"></script>











<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'default',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  
      

<script>
  if (typeof MathJax === 'undefined') {
    window.MathJax = {
      loader: {
          load: ['[tex]/mhchem'],
        source: {
          '[tex]/amsCd': '[tex]/amscd',
          '[tex]/AMScd': '[tex]/amscd'
        }
      },
      tex: {
        inlineMath: {'[+]': [['$', '$']]},
          packages: {'[+]': ['mhchem']},
        tags: 'ams'
      },
      options: {
        renderActions: {
          findScript: [10, doc => {
            document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
              const display = !!node.type.match(/; *mode=display/);
              const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
              const text = document.createTextNode('');
              node.parentNode.replaceChild(text, node);
              math.start = {node: text, delim: '', n: 0};
              math.end = {node: text, delim: '', n: 0};
              doc.math.push(math);
            });
          }, '', false],
          insertedScript: [200, () => {
            document.querySelectorAll('mjx-container').forEach(node => {
              let target = node.parentNode;
              if (target.nodeName.toLowerCase() === 'li') {
                target.parentNode.classList.add('has-jax');
              }
            });
          }, '', false]
        }
      }
    };
    (function () {
      var script = document.createElement('script');
      script.src = '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
      script.defer = true;
      document.head.appendChild(script);
    })();
  } else {
    MathJax.startup.document.state(0);
    MathJax.texReset();
    MathJax.typeset();
  }
</script>

    

  

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css">

<script>
NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => {
    var gitalk = new Gitalk({
      clientID    : '7ed324dbfd2741c35c0e',
      clientSecret: '75a59e1f6a55202c4a1b0ec3570ad5b5dccbc390',
      repo        : 'bqlin.github.io',
      owner       : 'bqlin',
      admin       : ['bqlin'],
      id          : '59de67c9eaaf56678a13db214dcd7956',
        language: 'zh-CN',
      distractionFreeMode: true
    });
    gitalk.render('gitalk-container');
  }, window.Gitalk);
});
</script>

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"jsonPath":"/live2dw/assets/hijiki.model.json"},"display":{"position":"right","vOffset":-100},"mobile":{"show":false,"scale":0.5},"log":false});</script></body>
</html>
